/**********************************************
这是代码自动生成的，如果重新生成，所做的改动将会丢失
系统:gpssolution
模块:系统平台
Itop.com 版权所有
生成者：Rabbit
生成时间:2012-8-1 10:14:11
***********************************************/

using System;
using System.Threading;
using System.ComponentModel;
namespace Itop.GpsCar.Model
{
    /// <summary>
    ///[alarmsetting]业务实体类
    ///对应表名:alarmsetting
    /// </summary>
    [Serializable]
    public class alarmsetting
    {
        
        #region Private 成员
        private int _idalarmsetting=0; 
        private int _deviceid=0; 
        private string _alarm_desc=String.Empty; 
        private int _alarm_catalogy=0; 
        private int _alarm_type=0; 
        private int _alarm_status=0; 
        private string _alarm_period=String.Empty; 
        private string _alarm_setting=String.Empty; 
        private double _alarm_tolerance=0; 
        private string _alarm_trigger=String.Empty; 
        private string _alarm_trigger_paras=String.Empty; 
        private int _auto_rest=0; 
        private DateTime _expire_time=new DateTime(1900,1,1); 
        private DateTime _timestamp=new DateTime(1900,1,1); 
        private string _reserved_1=String.Empty; 
        private string _reserved_2=String.Empty;   
        #endregion
  
  
        #region Public 成员
   
        /// <summary>
        /// 属性名称：idAlarmSetting
        /// 属性描述：
        /// 字段信息：[idAlarmSetting],INT UNSIGNED
        /// </summary>
        [Browsable(false)]
        [DisplayNameAttribute("")]
        public int idAlarmSetting
        {
            get { return _idalarmsetting; }
            set
            {			
                if (_idalarmsetting as object == null || !_idalarmsetting.Equals(value))
                {
                    _idalarmsetting = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：DeviceId
        /// 属性描述：
        /// 字段信息：[DeviceId],INT UNSIGNED
        /// </summary>
        [DisplayNameAttribute("")]
        public int DeviceId
        {
            get { return _deviceid; }
            set
            {			
                if (_deviceid as object == null || !_deviceid.Equals(value))
                {
                    _deviceid = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：Alarm_desc
        /// 属性描述：
        /// 字段信息：[Alarm_desc],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string Alarm_desc
        {
            get { return _alarm_desc; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_alarm_desc as object == null || !_alarm_desc.Equals(value))
                {
                    _alarm_desc = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：Alarm_catalogy
        /// 属性描述：Position = 1, DeviceStatus=2
        /// 字段信息：[Alarm_catalogy],INT
        /// </summary>
        [DisplayNameAttribute("Position = 1")]
        public int Alarm_catalogy
        {
            get { return _alarm_catalogy; }
            set
            {			
                if (_alarm_catalogy as object == null || !_alarm_catalogy.Equals(value))
                {
                    _alarm_catalogy = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：Alarm_type
        /// 属性描述：ReachPosition = 1, OffPath =2, OffRegion=3 , OverSpeed=4, DeviceStart=5, DeviceStop=6 , PanicButton =7
        /// 字段信息：[Alarm_type],INT
        /// </summary>
        [DisplayNameAttribute("ReachPosition = 1")]
        public int Alarm_type
        {
            get { return _alarm_type; }
            set
            {			
                if (_alarm_type as object == null || !_alarm_type.Equals(value))
                {
                    _alarm_type = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：Alarm_status
        /// 属性描述：AlarmDisabled = 0, AlarmArmed = 1, AlarmTriggered = 2
        /// 字段信息：[Alarm_status],INT
        /// </summary>
        [DisplayNameAttribute("AlarmDisabled = 0")]
        public int Alarm_status
        {
            get { return _alarm_status; }
            set
            {			
                if (_alarm_status as object == null || !_alarm_status.Equals(value))
                {
                    _alarm_status = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：Alarm_period
        /// 属性描述： /// Verify is checkTime in alarm armed period
        /// [GlobalStartTime]|[GlobalEndtime]|[frequency]|[repeatInterval]|[repeatCount]|[dayList]|[periods]
        /// [GlobalStartTime] and [GlobalEndtime] format(UTC):  2008-11-01T19:35:00.0000000Z|2009-11-01T19:35:00.0000000Z
        /// [frequency]:onetime, daily, weekly, monthly, yearly
        /// [repeatInterval]: int and repeatInterval > 0. 
        /// [repeatCount]: count > 0 or count == "-1" is infinite, but not used here right now since we use GlobalEndTime to specify global period
        /// [dayList](empty for onetime and daily):List for weekly is Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday , for monthly is 1 ~ 31, for yearly is 04-15 etc
        /// [periods]: UTC time for arm time period (no date info), it always "ordered sequence and every two as a pair" e.g. 15:30:00,15:45:00,16:00:00,17:00:05
        /// 字段信息：[Alarm_period],TEXT
        /// </summary>
        [DisplayNameAttribute("")]
        public string Alarm_period
        {
            get { return _alarm_period; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 0)
                throw new Exception("[ ]长度不能大于0!");
                if (_alarm_period as object == null || !_alarm_period.Equals(value))
                {
                    _alarm_period = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：Alarm_setting
        /// 属性描述：for position catalogy: sequence of position. latitude, longtitude,  latitude, longtitude,  latitude, longtitude ....
        /// 字段信息：[Alarm_setting],TEXT
        /// </summary>
        [DisplayNameAttribute("for position catalogy: sequence of position. latitude")]
        public string Alarm_setting
        {
            get { return _alarm_setting; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 0)
                throw new Exception("[for position catalogy: sequence of position. latitude]长度不能大于0!");
                if (_alarm_setting as object == null || !_alarm_setting.Equals(value))
                {
                    _alarm_setting = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：Alarm_tolerance
        /// 属性描述：# of KM tolerance
        /// 字段信息：[Alarm_tolerance],FLOAT
        /// </summary>
        [DisplayNameAttribute("# of KM tolerance")]
        public double Alarm_tolerance
        {
            get { return _alarm_tolerance; }
            set
            {			
                if (_alarm_tolerance as object == null || !_alarm_tolerance.Equals(value))
                {
                    _alarm_tolerance = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：Alarm_trigger
        /// 属性描述：[email]|[sms]|[phone]
        /// 字段信息：[Alarm_trigger],VARCHAR
        /// </summary>
        [DisplayNameAttribute("[email]|[sms]|[phone]")]
        public string Alarm_trigger
        {
            get { return _alarm_trigger; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[[email]|[sms]|[phone]]长度不能大于45!");
                if (_alarm_trigger as object == null || !_alarm_trigger.Equals(value))
                {
                    _alarm_trigger = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：Alarm_trigger_paras
        /// 属性描述：[email address]|[phone number]|[phone number]
        /// 字段信息：[Alarm_trigger_paras],VARCHAR
        /// </summary>
        [DisplayNameAttribute("[email address]|[phone number]|[phone number]")]
        public string Alarm_trigger_paras
        {
            get { return _alarm_trigger_paras; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 128)
                throw new Exception("[[email address]|[phone number]|[phone number]]长度不能大于128!");
                if (_alarm_trigger_paras as object == null || !_alarm_trigger_paras.Equals(value))
                {
                    _alarm_trigger_paras = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：Auto_rest
        /// 属性描述：0 - means not auto reset from AlarmTriggered status to AlarmArmedotherwise # of ms for auto reset back to AlarmArmed
        /// 字段信息：[Auto_rest],INT
        /// </summary>
        [DisplayNameAttribute("0 - means not auto reset from AlarmTriggered status to AlarmArmedotherwise # of ms for auto reset back to AlarmArmed")]
        public int Auto_rest
        {
            get { return _auto_rest; }
            set
            {			
                if (_auto_rest as object == null || !_auto_rest.Equals(value))
                {
                    _auto_rest = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：Expire_time
        /// 属性描述：the expire time for this setting, null means no expire
        /// 字段信息：[Expire_time],DATETIME
        /// </summary>
        [DisplayNameAttribute("the expire time for this setting")]
        public DateTime Expire_time
        {
            get { return _expire_time; }
            set
            {			
                if (_expire_time as object == null || !_expire_time.Equals(value))
                {
                    _expire_time = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：timestamp
        /// 属性描述：
        /// 字段信息：[timestamp],TIMESTAMP
        /// </summary>
        [DisplayNameAttribute("")]
        public DateTime timestamp
        {
            get { return _timestamp; }
            set
            {			
                if (_timestamp as object == null || !_timestamp.Equals(value))
                {
                    _timestamp = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：reserved_1
        /// 属性描述：
        /// 字段信息：[reserved_1],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string reserved_1
        {
            get { return _reserved_1; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_reserved_1 as object == null || !_reserved_1.Equals(value))
                {
                    _reserved_1 = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：reserved_2
        /// 属性描述：
        /// 字段信息：[reserved_2],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string reserved_2
        {
            get { return _reserved_2; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_reserved_2 as object == null || !_reserved_2.Equals(value))
                {
                    _reserved_2 = value;
                }
            }			 
        }
  
        #endregion 
  
        #region 方法
        public static string Newid(){
            return DateTime.Now.ToString("yyyyMMddHHmmssffffff");
        }
        public string CreateID(){
            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
            return DateTime.Now.ToString("yyyyMMddHHmmssffffff");
        }
        #endregion		
    }	
}
